<?php

/**
 * This is the model class for table "jumlahproduksihutantanaman".
 *
 * The followings are the available columns in table 'jumlahproduksihutantanaman':
 * @property integer $jpht_id
 * @property string $jpht_jenis
 * @property string $jpht_satuan
 * @property integer $jpht_produksi
 * @property integer $jpht_nilai
 * @property integer $jpht_tahun
 */
class Jumlahproduksihutantanaman extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Jumlahproduksihutantanaman the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'jumlahproduksihutantanaman';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('jpht_produksi, jpht_nilai, jpht_tahun', 'numerical', 'integerOnly'=>true),
			array('jpht_jenis', 'length', 'max'=>64),
			array('jpht_satuan', 'length', 'max'=>8),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('jpht_id, jpht_jenis, jpht_satuan, jpht_produksi, jpht_nilai, jpht_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'jpht_id' => 'Jpht',
			'jpht_jenis' => 'Jpht Jenis',
			'jpht_satuan' => 'Jpht Satuan',
			'jpht_produksi' => 'Jpht Produksi',
			'jpht_nilai' => 'Jpht Nilai',
			'jpht_tahun' => 'Jpht Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('jpht_id',$this->jpht_id);
		$criteria->compare('jpht_jenis',$this->jpht_jenis,true);
		$criteria->compare('jpht_satuan',$this->jpht_satuan,true);
		$criteria->compare('jpht_produksi',$this->jpht_produksi);
		$criteria->compare('jpht_nilai',$this->jpht_nilai);
		$criteria->compare('jpht_tahun',$this->jpht_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}